<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>024.3.跨源资源共享.html</title>
    <style>
    </style>
</head>
<body>
        <span id="sp">跨源资源共享</span>
</body>
<script>

fetch('http://localhost:8888/index/t02',{
        method: 'POST', // *GET, POST, PUT, DELETE, etc.
        credentials: 'same-origin', // include, *same-origin, omit
        headers: {
        'Content-Type': 'application/json', 
        // 'Content-Type': 'application/x-www-form-urlencoded',
        'X-token': '123123123'
        },
        body: JSON.stringify({
            k1: 'houzi',
            k2: 'age:18'
        })
    })
  .then(response => response.json())
  .then(data => {
    console.log(data)
  });

</script>
</html>